#!/usr/bin/perl
# index.cgi

# load modules
require "./ebbms-lib.pl";


# read argument in %in
&ReadParse();


# show header
&ui_print_header(undef, $text{"index_title"}, "", undef, 1, 1);


# create temp directory
#$temporary_path = &transname();
#mkdir("$temporary_path");


# display step tabs start
@tabs = (["status", $text{"index_tab_status"}, "index.cgi?tab=status"],
	["animation", $text{"index_tab_animation"}, "index.cgi?tab=animation"],
	["maintenance", $text{"index_tab_maintenance"}, "index.cgi?tab=maintenance"],
	["information", $text{"index_tab_information"}, "index.cgi?tab=information"],
	["config", $text{"index_tab_config"}, "index.cgi?tab=config"],
	);
print &ui_tabs_start(\@tabs, "tabs", $in{"tab"} || "status", 1);


# status tab
require "./status-tab.pl";
print &ui_tabs_start_tab("tabs", "status");
print &status_tab();
print &status_run();
print &ui_tabs_end_tab();


# animation tab
require "./animation-tab.pl";
print &ui_tabs_start_tab("tabs", "animation");
print &animation_tab();
print &animation_run();
print &ui_tabs_end_tab();


# maintenance tab
require "./maintenance-tab.pl";
print &ui_tabs_start_tab("tabs", "maintenance");
print &maintenance_tab();
print &maintenance_run();
print &ui_tabs_end_tab();


# information tab
require "./information-tab.pl";
print &ui_tabs_start_tab("tabs", "information");
print &information_tab();
print &information_run();
print &ui_tabs_end_tab();


# config tab
require "./config-tab.pl";
print &ui_tabs_start_tab("tabs", "config");
print &config_tab();
print &config_run();
print &ui_tabs_end_tab();


# show step tabs end
print &ui_tabs_end(1);

print "<br>\n";
print "<br>\n";
print "<br>\n";
print "<br>\n";
print "<hr>\n";
print "--- Debug Code --------------------------", "<br>\n";
print "argument<br>";

my $cnt = 1;
while (($key, $value) = each (%in)) {
	print "$cnt. $key = $value<br>\n";
	$cnt++;
}


print "<br>\n";
print "config<br>";

my $cnt = 1;
while (($key, $value) = each (%config)) {
	print "$cnt. $key = $value<br>\n";
	$cnt++;
}


#print "<br>\n";
#print "module_info<br>";
#
#my $cnt = 1;
#while (($key, $value) = each (%module_info)) {
#	print "$cnt. $key = $value<br>\n";
#	$cnt++;
#


print "<br>";
print "&find_ebbmsd()";
print &find_ebbmsd();
print "<br>";




print "--- Debug Code --------------------------", "<br>\n";

# show footer
&ui_print_footer("/", $text{"index"});

